import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;

public class Metric {
    String packageName;
    int classNumSum;
    /*******************************************************/
    // 耦合度指标
    // 跨包使用指数
    int packageUsesSum;  // 包含同包
    int difPackageUsesSum;  // 考虑异包

    float packageIIPU;

    // 跨包扩展指数
    int packageExtSum;
    int difPackageExtSum;

    float packageIIPE;

    // 包更改影响指数
    float packageIPCI;

    // 包通信偏移指数
    // 包使用分散指数
    ArrayList<Integer> difPackageUsesP;
    int difPackageUsesPNum;
    float packagePUF;
    float packageIIPUD;

    // 包扩散分散指数
    ArrayList<Integer> difPackageExtP;
    int difPackageExtPNum;
    float packagePEF;
    float packageIIPED;

    /*******************************************************/
    // 内聚度指标
    // 包目标集中指数
    ArrayList<Integer> packageClientsP;  // P的客户包
    ArrayList<Integer> packageProviderP;  // P的提供者包
    ArrayList<Integer> packageInIntC;  //p的输入接口
    ArrayList<InIntPC> inIntPC; //记录P的客户包Q已经使用过的P的接口，避免重复
    int packageInIntCNum;
    int packageInIntPQ;
    int RoleClientsSum;

    float packageRolePQSum;

    float packagePF;

    // 包服务内聚性指标
    Map<Integer, String> providerCSPQ;  // P的CSPQ
    float csCohesionSum;
    float packageIPSC;

    // 构造方法，赋初值
    public Metric(){
        packageUsesSum = difPackageUsesSum = 0;
        packageExtSum = difPackageExtSum = 0;
        difPackageUsesP = new ArrayList<>();
        difPackageExtP = new ArrayList<>();
        inIntPC = new ArrayList<>();
        difPackageUsesPNum = difPackageExtPNum = 0;

        // 内聚度指标赋初值
        packageClientsP = new ArrayList<>();
        packageProviderP = new ArrayList<>();
        packageInIntC = new ArrayList<>();
        packageInIntCNum = packageInIntPQ = RoleClientsSum = 0;
        packageRolePQSum = 0;

        providerCSPQ = new HashMap<>();
        csCohesionSum = 0;

    }
}
